home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
pascal
/
shazam.exe
/
BCAST.DEF
< prev
next >
Wrap
Text File
|
1992-09-01
|
2KB
|
57 lines
.Using Broadcasts vs. Commands
COMMENTS
--------
Demonstrate the difference between "evCommand" and "evBroadcast".
This is a very simple program, with two (2) menu selections and three
(3) events.
SHAZAM looks in the *.EVT file and extracts routines with the
following prefixes:
PREFIX HANDLEVENT (*.HE) file
------ ----------
"hb" create an entry in "HandleBroadcast"
"hd" create an entry in "HandleCommand"
Examine the generated code; if you are less than certain about how
the code behaves, use the TP IDE/Debugger to "Trace" the chain of
events, to see how "events" are routed and handled.
+-------+
|MENUBAR|
+-------+ +------+
Send direct ---------------------> |Single|
Send broadcast ---------------------> |Event |
|Queue |
+------+
|
+-----------+ |
| GetEvent | <------------+
+-----------+----+
|
+-----------+ <--+
+----- |HandleEvent| <---------------+ tagged "evBroadcast"
| +-----------+ |
| | |
| | | "Message" calls
\/ \/ | ^.HandleEvent
HandleBroadcast HandleCommand |
("evBroadcast") ("evCommand") |
--------------- ------------- |
SendIndirect SendBroadcast -----+
| SendDirect
| |
\/ \/
+------------+
|"MessageBox"|
+------------+
@PA - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[ MENUBAR ]
'send ~d~irect' ;;invoke "MessageBox" directly
'send ~b~roadcast' ;;invoke "MessageBox" via broadcast